/*
 * Copyright (c) 2008 by 1eEurope (Switzerland) AG, Thalwil
 *
 * Customer:	1eEurope (Switzerland) AG
 * Project:		BKS
 * Created:		30.09.2008, WBL
 *
*/

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;

namespace By1eEurope.BKS.Controls
{
    /// <summary>
    /// Value class of the BKS Image Field Type
    /// </summary>
    public class ImageValue
    {
        private string imageUrl;
        private string altText;
        private string longDesc;
        private string linkUrl;

        public ImageValue() { }

        public ImageValue(string value)
        {
            string[] arr = value.Split(new string[] { ";#" },StringSplitOptions.None);
            if (arr.Length >= 4)
            {
                this.imageUrl = arr[0];
                this.altText = arr[1];
                this.longDesc = arr[2];
                this.linkUrl = arr[3];
            }
        }

        public override string ToString()
        {
            return this.imageUrl + ";#" + this.altText + ";#" + this.longDesc + ";#" + this.linkUrl;
        }

        public string ImageUrl
        {
            get { return this.imageUrl; }
            set { this.imageUrl = value; }
        }
        public string AltText
        {
            get { return this.altText; }
            set { this.altText = value; }
        }
        public string LongDescQS
        {
            get { return this.longDesc; }
            set { this.longDesc = value; }
        }
        public string LinkUrl
        {
            get { return this.linkUrl; }
            set { this.linkUrl = value; }
        }
    }
}
